Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python IndexError of Case14: paddle.nn.functional.glu #50016

Merged
merged 7 commits into from
Feb 10, 2023

Conversation

longranger2
Copy link
Contributor

@longranger2 longranger2 commented Jan 23, 2023

PR types

Bug fixes

PR changes

APIs

Describe

Solution

原因:glu函数的axis取值要求小于x.shape
解决方法:添加axis取值判断条件

@paddle-bot
Copy link

paddle-bot bot commented Jan 23, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为这个case加个单测吧

@@ -1918,6 +1918,7 @@ def split(x, num_or_sections, axis=0, name=None):
dim = dim.numpy()
dim = dim.item(0)
assert len(input.shape) + dim >= 0, "(rank(x) + axis) must >= 0"
assert dim < len(input.shape), "axis must < (rank(x)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(rank(x)是不是应该改成rank(x)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对的,我的疏忽

@@ -1997,6 +1998,7 @@ def _get_SectionsTensorList(one_list):
inputs['AxisTensor'] = dim
else:
assert len(input.shape) + dim >= 0, "(rank(x) + axis) must >= 0"
assert dim < len(input.shape), "axis must < (rank(x)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@longranger2
Copy link
Contributor Author

longranger2 commented Jan 30, 2023

单测我今天搞定

@longranger2
Copy link
Contributor Author

longranger2 commented Feb 5, 2023

为这个case加个单测吧

单测添加好了

wanghuancoder
wanghuancoder previously approved these changes Feb 6, 2023
Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@iclementine iclementine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit 62fe3cf into PaddlePaddle:develop Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants